package com.deyuanyun.pic.pbf.controller.dto.defect;

import com.deyuanyun.pic.common.util.ObjectUtil;
import com.deyuanyun.pic.wf.domain.TaskInstance;

import java.util.Date;

/**
 * 缺陷任务转换
 *
 * @author huanglw
 * @date 2016-7-8
 *
 * History: [修改人][时间][修改描述]
 */
public class TaskInstanceDto extends DefaultCommand<TaskInstance> {
    /**
     * 主键
     */
    private String id;

    /**
     * 缺陷信息ID
     */
    private String defectInfoId;

    /**
     * 流程定义ID
     */
    private String definitionId;

    /**
     * 节点ID
     */
    private String nodeId;

    /**
     * 节点名称
     */
    private String nodeName;

    /**
     * 是否完成该节点任务：0，没有完成；1，已经完成
     */
    private Short isCompletion;

    /**
     * 排序号
     */
    private Short sort;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDefectInfoId() {
        return defectInfoId;
    }

    public void setDefectInfoId(String defectInfoId) {
        this.defectInfoId = defectInfoId;
    }

    public String getDefinitionId() {
        return definitionId;
    }

    public void setDefinitionId(String definitionId) {
        this.definitionId = definitionId;
    }

    public String getNodeId() {
        return nodeId;
    }

    public void setNodeId(String nodeId) {
        this.nodeId = nodeId;
    }

    public String getNodeName() {
        return nodeName;
    }

    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }

    public Short getIsCompletion() {
        return isCompletion;
    }

    public void setIsCompletion(Short isCompletion) {
        this.isCompletion = isCompletion;
    }

    public Short getSort() {
        return sort;
    }

    public void setSort(Short sort) {
        this.sort = sort;
    }


    @Override
    public void fromDomain(TaskInstance domain) {

        if (ObjectUtil.isEmptyAll(domain)) {
            return;
        }

        this.id = domain.getId();
        this.defectInfoId = domain.getDefectInfoId();
        this.definitionId = domain.getDefinitionId();
        this.nodeId = domain.getNodeId();
        this.nodeName = domain.getNodeName();
        this.isCompletion = domain.getIsCompletion();
        this.sort = domain.getSort();
    }
}
